
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html>
<head>
<title>Forget Password</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body{background:url(img/bg.jpg);}

.header{width:100%; float:left;}

#logo{width:100%;}

.login-heading{text-align:center; color:#FFFFFF;}

.loginform {
    width: 100%;
    height: 250px;
    background:url('img/login_bg.png') no-repeat scroll center top transparent;
}

.login{width:40%; text-align:center; margin:0px auto;}
.login-input{width:280px; height:25px; background:#320b28; color:#FFFFFF;}
.submit{background:#000; border:none; height:25px; width:100px; margin-top:20px; color:#FFFFFF;}

.close {
    background-color: rgba(0, 0, 0, 0.8);
    height: 30px;
    line-height: 30px;
    position: absolute;
    right: 384px;
    text-align: center;
    text-decoration: none;
    top: 190px;
    width: 30px;

    -webkit-border-radius: 15px;
    -moz-border-radius: 15px;
    -ms-border-radius: 15px;
    -o-border-radius: 15px;
    border-radius: 15px;
}
.close:before {
    color: rgba(255, 255, 255, 0.9);
    content: "X";
    font-size: 24px;
    text-shadow: 0 -1px rgba(0, 0, 0, 0.9);
}
.close:hover {
    background-color: rgba(64, 128, 128, 0.8);
}
</style>
<script type="text/javascript">
	
	
	$(document).ready(function() {
		$('#cpwd').live("paste",function(e) {
			 e.preventDefault();

		 });

		 $('#pwd').live("cut copy paste",function(e) {
			 e.preventDefault();

			});

		var error=false;
		$("#save").click(function(event) { 
		
			if((document.getElementById('uname').value)=='' || (document.getElementById('pwd').value)=='' || (document.getElementById('cpwd').value)==''){
				error	=	true;
				 document.location.href="/ncmxtradeX/forgotPwd";
				
			
			}
			
			if(error==false){
			var reqUrl="./user/ForgetPwd";
			var p1=$("#pwd").val();  
			var p2=$("#cpwd").val();
			if(p1==p2){
				var jsondata = JSON.stringify({ "password":$("#pwd").val(),"userId":$("#uname").val()});
				$.ajax(
			  	{
			 	 type: "POST",
			 	 url: reqUrl,
			  	dataType: "json",
			  	contentType: 'application/json',	  
			  	data:jsondata, 
			  	success: function(jsonResponse) { 
				 	alert(jsonResponse);
				 	alert(jsonResponse["msg"]);
				 	document.getElementById("uname").value="";
				  	document.getElementById("pwd").value="";
				  	document.getElementById("cpwd").value="";
			  } 
			});
			 event.preventDefaults();
			}else{
				alert("Password Field does not matches with Confirm Password.");
			}
			}
		});
	});
	
	

</script>
</head>
<body >
<div class="header">
    <div class="logo"><a href="#"><img src="img/ncmx-logo.png" style="width:25%;"/></a></div>
    </div>
  <div class="login-heading">
	<h2 style="font-family: 'Monotype Corsiva';">Forgot Password</h2>
	</div>
	<div class="loginform" id="progress">
	<form name='f' action='/ncmxtradeX' method="post" class="login">
		<table style="border:none; clear:both; text-align:center; padding:50px 20px;width: 700px;">
	
			<tr>
				<td style="font-family: 'Monotype Corsiva'; font-weight:600; font-size:21px;">UserID:</td>
				<td style="float:left; width:400px; margin:0 0 10px 0;">
				<input type='text' name='username' value='' id="uname" placeHolder="Enter Your ID" required="true" size="30" class="login-input"/></td>
			</tr>
			<tr>
				<td style="font-family: 'Monotype Corsiva';font-weight:600; font-size:21px;">New Password:</td>
				<td style="float:left; width:400px; margin:0 0 10px 0;">
				<input type='password' name='password' id="pwd" placeHolder="Enter New Password" required="true" size="30" class="login-input"/></td>
			</tr>
			<tr>
				<td style="font-family: 'Monotype Corsiva'; font-weight:600; font-size:21px;width:153px">Confirm Password:</td>
				<td style="float:left; width:400px; margin:0 0 10px 0;">
				<input type='password' name='cpassword' id="cpwd" placeHolder="Confirm Your Password" required="true" size="30" class="login-input"/></td>
			</tr>
			<tr>
				<td></td>
				<td colspan='2' style="clear:both; width:500px; text-align:left; padding:0 0 0 10px;">
				<input name="submit" type="submit" id="save" value="Save" style="width: 81px;" class="submit"   /></td>
			</tr>		
		</table>
		<a class="close" id="close" href="login"></a>  
	</form>
	  
	</div> 
	
</body>
</html>